package com.zlWebAutoTest.common;

import org.openqa.selenium.edge.EdgeDriver;
import org.openqa.selenium.edge.EdgeOptions;

import java.time.Duration;

public class AutoTestUtils {
    public static EdgeDriver driver;

    //创建驱动对象
    public  static EdgeDriver createDriver() {
        //驱动对象已经创建好了或者没有创建
        if (driver == null) {
            EdgeOptions options = new EdgeOptions();
            options.addArguments("--remote-allow-origins=*");
            driver = new EdgeDriver(options);
            //创建隐式等待
            driver.manage().timeouts().implicitlyWait(Duration.ofSeconds(10));
        }
        return driver;
    }
}
